﻿<UserControl x:Class="Road3App.Views.UserControls.CrossRoadVehicleUC"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:c="clr-namespace:Road3App.Services.Converters">
    <Grid>
        <Grid.Resources>
            <c:CrossRoadVehicleRotationConverter x:Key="rotationConv"/>
            <c:IntToColorConverter x:Key="colorConv"/>
        </Grid.Resources>
        <Grid.RenderTransform>
            <RotateTransform CenterX="10" CenterY="10">
                <RotateTransform.Angle>
                    <MultiBinding Converter="{StaticResource rotationConv}">
                        <Binding Path="PrevCell"/>
                        <Binding Path="CurrentCell"/>
                        <Binding Path="NextCell"/>
                    </MultiBinding>
                </RotateTransform.Angle>
            </RotateTransform>
        </Grid.RenderTransform>
        
        <Ellipse Width="10" Height="10"
                 Fill="{Binding Color, Converter={StaticResource colorConv}}"
                 Margin="0,0,0,5"/>
        <Rectangle Width="10" Height="10"
                   Fill="{Binding Color, Converter={StaticResource colorConv}}"/>
        
    </Grid>
</UserControl>
